﻿<%@ Page Language="C#" AutoEventWireup="true" CodeFile="PurchaseOrderApproval.aspx.cs"
    Inherits="Main_Inventory_PurchaseOrderApproval" EnableEventValidation="false" %>

<%@ Register Src="~/User Controls/PageHeading.ascx" TagName="heading" TagPrefix="acc" %>
<%@ Register Src="~/User Controls/CommonControls.ascx" TagName="CommonControls" TagPrefix="MyControls" %>
<%@ Register Src="~/User Controls/Pager.ascx" TagPrefix="custom" TagName="Pager" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <link href="../../Styles/accounts.css" rel="stylesheet" type="text/css" />
    <title>Purchase Order Approval</title>
</head>
<body>
    <form id="form1" runat="server">
    <acc:heading ID="pagehead" runat="server" HeadingText="PO Approval" />
    <asp:ScriptManager ID="ScriptManager1" runat="server" EnablePageMethods="true" EnablePartialRendering="true">
    </asp:ScriptManager>
    <div style="width: 90%; margin-left: 5%; margin-right: 5%">
        <asp:UpdateProgress DynamicLayout="false" ID="UpdProgress" runat="server">
            <ProgressTemplate>
                <div align="center">
                    <img src="../../Images/ajax-loader.gif" /></div>
            </ProgressTemplate>
        </asp:UpdateProgress>
        <asp:UpdatePanel ID="UP1" runat="server">
            <Triggers>
                <asp:PostBackTrigger ControlID="CommonControls1" />
            </Triggers>
            <ContentTemplate>
                <div style="margin-left: 35%;">
                    <asp:Label ID="lblMsg" runat="server" Font-Bold="true"></asp:Label></div>
                <asp:Panel ID="PanelDisplay" runat="server" Width="100%">
                    <div style="padding-top: 5px; padding-bottom: 5px; margin-left: 30%;">
                        <div style="float: left;">
                            <custom:Pager ID="custPager" runat="server" OnPageChanged="custPager_PageChanged" />
                        </div>
                        <div style="float: left; margin-left: 10px;">
                            <MyControls:CommonControls ID="CommonControls1" runat="server" GridviewControlId="grdDisplay"
                                HideColumns="7" />
                        </div>
                    </div>
                    <div id="divprint" runat="server">
                        <asp:GridView ID="grdDisplay" Width="95%" runat="server" AutoGenerateColumns="False"
                            CssClass="gridview" AllowPaging="true" PageSize="15" DataKeyNames="POID" RowStyle-CssClass="gridviewitem"
                            PagerStyle-CssClass="pgr" AlternatingRowStyle-CssClass="gridview_alternate" OnRowDataBound="grdDisplay_RowDataBound"
                            OnRowCommand="grdDisplay_RowCommand" OnPageIndexChanging="grdDisplay_PageIndexChanging"
                            OnRowCreated="grdDisplay_RowCreated">
                            <Columns>
                                <asp:TemplateField HeaderText="S.No." ItemStyle-HorizontalAlign="Center">
                                    <ItemTemplate>
                                        <%# Container.DataItemIndex+1 %>
                                    </ItemTemplate>
                                    <HeaderStyle HorizontalAlign="Center" />
                                    <ItemStyle HorizontalAlign="Center" />
                                </asp:TemplateField>
                                <%--<asp:BoundField HeaderText="P.O. No." DataField="PONo"/>--%>
                                <asp:TemplateField HeaderText="P.O. No.">
                                    <ItemTemplate>
                                        <%--<a href="#" onclick="window.open('InventoryPrint/PurchaseOrderDisplay.aspx?Poid=<%#DataBinder.Eval(Container.DataItem,"POID")%>','','width=800,height=600,toolbar=no,status=yes,menubar=no,scrollbars=yes,resizable=yes')">--%>
                                        <asp:Label ID="lblpono" runat="server" Text='<%#Eval("PONo")%>'></asp:Label><%--</a>--%>
                                    </ItemTemplate>
                                </asp:TemplateField>
                                <asp:BoundField HeaderText="Placed On" DataField="cdate" />
                                <asp:BoundField HeaderText="Placed By" DataField="cname" />
                                <asp:BoundField HeaderText="Approval Date" DataField="ApprovalDate" NullDisplayText="-" />
                                <asp:BoundField HeaderText="Approval By" DataField="ApprovalBy" NullDisplayText="-" />
                                <asp:BoundField HeaderText="Status" DataField="Status" HeaderStyle-HorizontalAlign="Center"
                                    ItemStyle-Font-Bold="true" ItemStyle-HorizontalAlign="Left" />
                                <asp:TemplateField HeaderText="Action">
                                    <ItemTemplate>
                                        <asp:LinkButton ID="lnkbtnEdit" runat="server" CausesValidation="False" OnClick="lnkbtnEdit_Click"
                                            CommandName="Edit" Text="Edit" CommandArgument='<%#Eval("POID")%>'></asp:LinkButton>
                                        <asp:Image ID="imgapproved" runat="server" ImageUrl="../../Menu/images/approv.png" />
                                    </ItemTemplate>
                                    <HeaderStyle HorizontalAlign="Center" />
                                </asp:TemplateField>
                            </Columns>
                            <PagerStyle HorizontalAlign="Right" />
                            <HeaderStyle HorizontalAlign="Center" />
                        </asp:GridView>
                    </div>
                </asp:Panel>
                <asp:Panel ID="paneledit" runat="server" Visible="false">
                    <table class="tablecontent" style="width: 50%; margin-left: 25%; margin-right: 25%;
                        border: 1px solid #818181">
                        <tr>
                            <td class="headtd" colspan="2">
                                Purchase Order Details
                            </td>
                        </tr>
                        <tr>
                            <td>
                                P.O. No. <span class="required">*</span>
                            </td>
                            <td>
                                <asp:Label ID="lblpurchaseorder" runat="server" Width="130px" ValidationGroup="name"></asp:Label>
                            </td>
                        </tr>
                        <tr>
                            <td>
                                Status
                            </td>
                            <td>
                                <asp:DropDownList ID="DdlStatus" runat="server" Width="130px" CssClass="dropdown"
                                    ValidationGroup="name">
                                </asp:DropDownList>
                                <span class="required">*</span>
                            </td>
                        </tr>
                        <tr>
                            <td>
                                Order Placed By
                            </td>
                            <td>
                                <asp:Label ID="lblorderplace" runat="server"></asp:Label>
                            </td>
                        </tr>
                        <tr>
                            <td align="right">
                                <asp:Button ID="BtnUpdate" runat="server" Text="Update" CssClass="button" OnClick="BtnUpdate_Click" />
                            </td>
                            <td align="left">
                                <asp:Button ID="BtnClose" runat="server" Text="Close" CssClass="button" OnClick="BtnClose_Click" />
                            </td>
                        </tr>
                    </table>
                </asp:Panel>
            </ContentTemplate>
        </asp:UpdatePanel>
    </div>
    </form>
</body>
</html>
